fo = open("C:\\Users\\Administrator\\Desktop\\xiaofei.csv","r")
user = []
list1 = ["地区","消费支出","食品烟酒","衣着","居住","生活用品","交通通信","教育文化娱乐","医疗保健","其他用品及服务"]
i = 0
while True:
    str1 = input("输入查询的项目(输入1停止)\n")
    if(i > 1 and str1 == "1"):
        print("\n")
        break
    else:
        user.append(str1)
        i+=1
    

ls = []
for line in fo:
    line = line.replace("\n","")
    ls.append(line.split(","))
lns = ""
for s in ls:
    if s[0] == user[0]:
        ##lns += "{}\n".format(s)
        lns = s
print("你选择的地区是:"+user[0])
for i in range(len(user)):
    if i == 0:
        continue
    print(list1[i]+":"+lns[list1.index(user[i])])
fo.close()
